<%@ page contentType="text/plain;charset=UTF-8" %>
<%@ include file="/common/taglibs.jsp" %>
<%@ taglib prefix="json" uri="http://www.atg.com/taglibs/json" %>
<json:object>
    <json:property name="page"><s:property value="page.pageNo"/></json:property>
    <json:property name="total"><s:property value="page.totalCount"/></json:property>
    <json:array name="rows">
        <s:iterator value="page.result" id="entityData">
        <json:object>
            <json:property name="id" ><s:property value="#entityData.id" escape="false"/></json:property>
            <json:property name="fatherId" ><s:property value="#entityData.fatherId" escape="false"/></json:property>
            <json:property name="streamName" ><s:property value="#entityData.streamName" escape="false"/></json:property>
            <json:property name="isDefault" ><s:property value="@com.iqiyi.pps.epg.core.model.stream.LiveStream@LIVE_STREAM_ISDEFAULT_MAP.get(#entityData.isDefault)" escape="false"/></json:property>
            <%--<json:property name="isDefault" ><s:property value="#entityData.isDefault" escape="false"/></json:property>--%>
            <json:property name="uuid" ><s:property value="#entityData.uuid" escape="false"/></json:property>

            <json:property name="url" escapeXml="false">
                <c:if test="${entityData.formatType eq 'FLV'}">
                    <a href="http://www.iqiyi.com/common/flashplayer/20141218/LivePlayer_3_0_3_4.swf?vid=<s:property value="#entityData.url"/>&source=live.lego.iqiyi.com" target="_blank"><s:property value="#entityData.url" escape="false"/></a>
                </c:if>
                <c:if test="${entityData.formatType eq 'HCDN'}">
                    <a href="<s:property value="#entityData.url"/>" target="_blank"><s:property value="#entityData.url" escape="false"/></a>
                </c:if>
                <c:if test="${entityData.formatType eq 'TS'}">
                    <a href="http://m3u8.live.video.qiyi.com/tslive/<s:property value="#entityData.url"/>/<s:property value="#entityData.url"/>.m3u8" target="_blank"><s:property value="#entityData.url" escape="false"/></a>
                </c:if>
                <c:if test="${entityData.formatType eq 'MP4'}">
                    <a href="http://m3u8.live.video.qiyi.com/tslive/<s:property value="#entityData.url"/>/<s:property value="#entityData.url"/>.flv" target="_blank"><s:property value="#entityData.url" escape="false"/></a>
                </c:if>
                <c:if test="${entityData.formatType eq 'P2P'}">
                    <a href="<s:property value="#entityData.url"/>" target="_blank"><s:property value="#entityData.url" escape="false"/></a>
                </c:if>
            </json:property>
            <json:property name="formatType" ><s:property value="#entityData.formatType" escape="false"/></json:property>
            <json:property name="status" ><s:property value="@com.iqiyi.pps.epg.core.model.stream.LiveStream@LIVE_STREAM_STATUS_MAP.get(#entityData.status)" escape="false"/></json:property>
            <json:property name="addTime" ><s:property value="#entityData.addTime" escape="false"/></json:property>
            <json:property name="updateTime" ><s:property value="#entityData.updateTime" escape="false"/></json:property>
            <json:property name="operate" escapeXml="false">
                    <c:if test="${(entityData.status eq '0') || (entityData.status eq '2')}">
                        <c:if test="${entityData.formatType eq 'FLV'}">
                            <a href="javascript:void(0)" onclick="doing('${entityData.fatherId}', '${entityData.streamName}', '${ctx}/stream/flvStream/start.action')">启动</a>
                        </c:if>
                        <c:if test="${entityData.formatType eq 'TS'}">
                            <a href="javascript:void(0)" onclick="doing('${entityData.fatherId}', '${entityData.streamName}', '${ctx}/stream/tsStream/start.action')">启动</a>
                        </c:if>
                    </c:if>
                    <c:if test="${entityData.status eq '1'}">
                        <c:if test="${entityData.formatType eq 'FLV'}">
                            <a href="javascript:void(0)" onclick="doing('${entityData.fatherId}', '${entityData.streamName}', '${ctx}/stream/flvStream/stop.action')">停止</a>
                        </c:if>
                        <c:if test="${entityData.formatType eq 'TS'}">
                            <a href="javascript:void(0)" onclick="doing('${entityData.fatherId}', '${entityData.streamName}', '${ctx}/stream/tsStream/stop.action')">停止</a>
                        </c:if>
                    </c:if>
                    <c:if test="${entityData.formatType eq 'FLV'}">
                        <a href="javascript:void(0)" onclick="doing('${entityData.fatherId}', '${entityData.streamName}', '${ctx}/stream/flvStream/delete.action')">删除</a>
                    </c:if>
                    <c:if test="${entityData.formatType eq 'TS'}">
                        <a href="javascript:void(0)" onclick="doing('${entityData.fatherId}', '${entityData.streamName}', '${ctx}/stream/tsStream/delete.action')">删除</a>
                    </c:if>
                    <c:if test="${entityData.formatType eq 'P2P'}">
                        <a href="javascript:void(0)" onclick="doing('${entityData.fatherId}', '${entityData.streamName}', '${ctx}/stream/p2pStream/delete.action')">下线</a>
                    </c:if>
            </json:property>
        </json:object>
        </s:iterator>
    </json:array>
</json:object>